package cn.itcast.bos.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import cn.itcast.bos.domain.base.Standard;

public interface StandardDao extends JpaRepository<Standard, Integer> {

	List<Standard> findByName(String string);

	List<Standard> findByNameLike(String string);

	@Query(value="from Standard where name = ?1" ,nativeQuery=false)
	List<Standard> queryName(String string);

	@Query(value="select * from t_standard where c_name like ?",nativeQuery=true)
	List<Standard> queryNameLike(String string);

	@Query(value="from Standard where c_min_length between ?1 and ?2")
	List<Standard> queryLengthBetween(int i, int j);

	
	List<Standard> queryInId(int i, int j, int k);

	@Query(value="update Standard set minLength = ?1 where name = ?2")
	@Modifying
	void updateMinLength(int i, String string);

}
